﻿<local:BaseWizardWindow
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:PSE.Deployment.SetupBase.UI;assembly=PSE.Deployment.SetupBase"
	x:Class="Sinacor.Deployment.Setup.UI.CompanySelection"
	Title="Setup">

		<Grid>
		<Button HorizontalAlignment="Right" Style="{DynamicResource BotaoFechar}" VerticalAlignment="Top" Width="15" Height="15" Content="" Margin="0,15,15,0" x:Name="BtnClose"/>
		<TextBlock Margin="50,125,0,0" VerticalAlignment="Top" FontSize="12" TextWrapping="Wrap" HorizontalAlignment="Left" Width="860" Foreground="#FF333333"><Run FontSize="24" FontWeight="Bold" Foreground="#FF336699" Text="Instalação do Banco de Dados - Dados Complementares" Language="pt-br"/><LineBreak/><LineBreak/><Run Text="Escolha abaixo quais empresas deverão ser instaladas para verificar se as versões de bancos de dados são compatíveis." Language="pt-br"/></TextBlock>
		<Button Margin="0,0,140,50" Style="{DynamicResource setupBt}" x:Name="BtnPrevious" Content="Retornar" Background="{DynamicResource BtBackColor}" VerticalAlignment="Bottom" Height="21" Foreground="#FFFFFFFF" HorizontalAlignment="Right" Width="80"/>
		<Button Margin="0,0,50,50" Style="{DynamicResource setupBt}" x:Name="BtnNext" Content="Avançar" Background="{DynamicResource BtBackColor}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="80" Height="21" Foreground="#FFFFFFFF"/>
		<Label HorizontalAlignment="Left" Margin="466,195,0,0" VerticalAlignment="Top" Content="TNS Oracle" Width="80" FontSize="12" HorizontalContentAlignment="Right"/>
		<Label Content="Usuário" Width="80" FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="466,220,0,0" HorizontalContentAlignment="Right"/>
		<TextBox Margin="549,195,0,0" Style="{DynamicResource TextBoxPSE}" VerticalAlignment="Top" BorderBrush="{x:Null}" Text="{Binding ConnectionInfo.TNSName}" TextWrapping="Wrap" Width="361" HorizontalAlignment="Left" Height="21" FontSize="12" IsEnabled="False" />
		<TextBox Margin="549,222,0,0" Style="{DynamicResource TextBoxPSE}" VerticalAlignment="Top" BorderBrush="{x:Null}" Text="{Binding ConnectionInfo.User}" TextWrapping="Wrap" Height="21" FontSize="12" HorizontalAlignment="Left" Width="361" IsEnabled="False"/>
        <ListView x:Name="gdVersions" Background="{DynamicResource BackCinza}" ItemsSource="{Binding CompaniesVersions}" Style="{DynamicResource List}" Height="160" FontSize="12" FontWeight="Normal" IsSynchronizedWithCurrentItem="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" VerticalAlignment="Top" Margin="50,465,0,0" HorizontalAlignment="Left" Width="860">
			<ListView.View>
				<GridView ColumnHeaderContainerStyle="{DynamicResource ListaColunaCor}">
					<GridViewColumn Header="Empresa" Width="256" DisplayMemberBinding="{Binding Company.Name}" />
					<GridViewColumn Header="Módulo" Width="260" DisplayMemberBinding="{Binding Company.Module.Name}" />
					<GridViewColumn Header="Banco" Width="120" DisplayMemberBinding="{Binding Company.DataBaseVersion}" />
                    <GridViewColumn Header="Setup" Width="110" DisplayMemberBinding="{Binding ExtendedSetupVersions}"/>
                    <GridViewColumn Header="Status" Width="110">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Image HorizontalAlignment="Center" Width="19" Source="{DynamicResource StatusError}" ToolTip="{Binding ToolTipMessage}" VerticalAlignment="Top" Height="19" x:Name="StatusIcon"/>
                                <DataTemplate.Triggers>
                                    <DataTrigger Binding="{Binding Status}" Value="Ok">
                                        <Setter Property="Source" TargetName="StatusIcon" Value="{DynamicResource StatusOK}" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Status}" Value="NotOk">
                                        <Setter Property="Source" TargetName="StatusIcon" Value="{DynamicResource StatusError}" />
                                    </DataTrigger>
                                </DataTemplate.Triggers>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
			</ListView.View>
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                </Style>
            </ListView.ItemContainerStyle>
        </ListView>

        <Grid Margin="53,194,0,0" Height="264" VerticalAlignment="Top" HorizontalAlignment="Left" Width="418">
            <Rectangle Fill="{DynamicResource ListaColunaDegrade}" Stroke="#FF999999" Height="21" HorizontalAlignment="Stretch" VerticalAlignment="Top"/>
            <CheckBox Margin="15,3,0,0" FontSize="12" Foreground="#FF333333" HorizontalAlignment="Left" VerticalAlignment="Top" Content=" Empresas" x:Name="ChkCompany" Click="ChkCompany_Click"></CheckBox>
            <Rectangle Fill="{DynamicResource BackCinza}" Stroke="#FF999999" Margin="0,20,0,0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="Auto"/>
            <TreeView Foreground="#FF333333" FontSize="12" Background="{x:Null}" BorderBrush="{x:Null}" Margin="5,25,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" x:Name="TrvCompany">
            </TreeView>
        </Grid>

    </Grid>
</local:BaseWizardWindow>